'''
Author: Ryan
Email: 409266255@qq.com
Date: 2025-09-30 16:38:35

LastEditors: Ryan
LastEditTime: 2025-09-30 16:44:34
Description: 日志库使用示例

FilePath: /qopilot/tests/logging_examples.py
Copyright (c) 2025 by Ryan, All Rights Reserved. 
'''

from qopilot.log import get_logger, trading_logger, data_logger


def example_standard_logging():
    """标准库 logging 使用示例"""
    logger = get_logger("example")

    logger.info("这是一条信息日志")
    logger.warning("这是一条警告日志")
    logger.error("这是一条错误日志")

    # 交易专用日志
    trading_logger.info("买入信号触发", extra={"stock_code": "00700.HK", "price": 350.0})
    data_logger.info("数据更新完成", extra={"records_count": 1000})


if __name__ == "__main__":
    print("=== 标准库 logging 示例 ===")
    example_standard_logging()
